import * as THREE from 'three';

const geometry = new THREE.BufferGeometry();

// Create a quad/rectangle using 2 triangles
// Triangle 1: (0,0,0), (100,0,0), (0,100,0)
// Triangle 2: (100,0,0), (100,100,0), (0,100,0)
const vertices = new Float32Array([
    // Triangle 1
    0, 0, 0,
    100, 0, 0,
    0, 100, 0,
    // Triangle 2
    100, 0, 0,
    100, 100, 0,
    0, 100, 0
]);

const attribute = new THREE.BufferAttribute(vertices, 3);
geometry.attributes.position = attribute;

const material = new THREE.MeshBasicMaterial({
    color: new THREE.Color('blue'),
    side: THREE.DoubleSide // Make both sides visible
});

const mesh = new THREE.Mesh(geometry, material);

export default mesh;
